import httpUtils from "@/core/utils/http.utils";
// service path
const urls = {
    'getSysRolePage': `/api/upms/sysRole/page`,
    'getSysRoleById': `/api/upms/sysRole/`,
    'getSysMenuTree': `/api/upms/sysMenu/tree`, // 获取菜单tree
    'getUsrSysMenuTree': `/api/upms/sysMenu/tree/`, // 获取用户角色菜单tree
    'getTreeByRole': `/api/upms/sysMenu/getTreeByRole/`, // 根据三元角色显示不同权限树
    'updateRoleMenu': `/api/upms/sysRole/menu`, // 更新角色菜单
    'getRolePermis': `/api/upms/sysMenu/getRolePermis/` // 更新角色菜单
};
// service methods
const sysAccreditApi = {
    getSysMenuTree (id) {
        return httpUtils.get(urls.getTreeByRole +id);
    },
    getUsrMenuTree (id) {
        return httpUtils.get(urls.getUsrSysMenuTree + id);
    },
    getSysRolePage (param) {
        return httpUtils.getEncrypt(urls.getSysRolePage, param);
    },
    getSysRoleById(id) {
        return httpUtils.get(urls.getSysRoleById + id, {});
    },
    getRolePermis(id) {
        return httpUtils.get(urls.getRolePermis + id);
    },
    updateRoleMenu(params) {
        return httpUtils.putEncrypt(urls.updateRoleMenu, params);
    },

};

export default sysAccreditApi;
